watch: track worker thread entry files in --watch mode#62368
watch: track worker thread entry files in --watch mode#62368SudhansuBandha wants to merge 6 commits intonodejs:mainfrom
Conversation
|
This solves the issue for the worker module itself, but not its dependencies. I.e. if a worker module imports/requires another module, modifying the latter still does not trigger re-run. |
|
I have updated changes to watch dependencies for worker as well, so changes in imported/required modules will now trigger a re-run. |
|
This is the wrong way to solve this, for a myriad of reasons: (based on a cursory glance of the code. Did not bother to actual test it)
Any solution must be integrated into Node's loading pipeline |
|
I will revert back these updates and work on the suggestions |
d26b727 to
ba11d26
Compare
franciscoarturorivera371-cyber
left a comment
There was a problem hiding this comment.
Submit the change.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@clemyan |
|
The added test already passes on |
|
Sure!! @aduh95 I will update the tests for this. Thanks for your feedback!! |
d4e5305 to
634a756
Compare
|
@aduh95 Please do review the updated tests for the proposed changes based on behaviour of worker file and it's dependencies in --watch mode for both cjs and esm modules. |
|
Can you not put the tests in |
634a756 to
5486d3f
Compare
|
@aduh95 As suggested I have removed tests from |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62368 +/- ##
=======================================
Coverage 89.70% 89.71%
=======================================
Files 695 695
Lines 214476 214523 +47
Branches 41072 41075 +3
=======================================
+ Hits 192405 192464 +59
+ Misses 14115 14109 -6
+ Partials 7956 7950 -6
🚀 New features to boost your workflow:
|
Currently, --watch mode only tracks dependencies from the main module graph (require/import). Worker thread entry points created via new Worker() are not included, so changes to worker files do not trigger restarts. This change hooks into Worker initialization and registers the worker entry file with watch mode, ensuring restarts when worker files change. Fixes: nodejs#62275 Signed-off-by: SudhansuBandha <sudhansu9.vssut@gmail.com>
9a661cd to
f7a05a3
Compare
Currently, --watch mode only tracks dependencies from the main module graph (require/import). Worker thread entry points created via new Worker() are not included, so changes to worker files do not trigger restarts.
This change hooks into Worker initialization and registers the worker entry file with the watch mode, ensuring restarts when worker files change.
Fixes: #62275